<%--
  Created by IntelliJ IDEA.
  User: zll
  Date: 2018/5/30
  Time: 12:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>店铺列表</title>

    <jsp:include page="../comm/comm.jsp"/>
</head>
<body>
<div class="layui-form" action="">
    <div class="layui-inline">
        <div class="layui-input-inline" style="width: 500px;">
            <input type="text" name="price_min" placeholder="输入要搜索的内容" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid"></div>
        <div class="layui-input-inline" style="width: 100px;">
            <button class="layui-btn">搜索</button>
        </div>
        <div class="layui-input-inline" style="width: 100px;">
            <button class="layui-btn layui-btn-warm" id="add">添加</button>
        </div>
    </div>
</div>
<table id="demo" lay-filter="test"></table>


<script type="text/html" id="operate">
    {{#  if(d.status ==1){ }}
    <button class="layui-btn layui-btn-sm layui-btn-warm" onclick="updateStatus('{{d.id}}','2')">审核</button>
    {{#  } }}
    {{#  if(d.status ==2){ }}
    已审核
    {{#  } }}
    {{#  if(d.status ==0){ }}
   待支付
    {{#  } }}

</script>
<script>
    function updateStatus(id) {
        config.commPost("/role/suditShop.json",{roleId:id},function (data) {
           location.reload();
        })
    };
    function modify(id){
        config.openLayer("修改","/role/modifyShop?userId="+id);
        //config.commPost("role/modifyUser.json")
    }
    layui.use('table', function(){
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#demo'
            ,url: '/role/listShop.json' //数据接口
            ,page: true //开启分页
            ,limits:[10]
            ,response: {
                statusName: 'status' //数据状态的字段名称，默认：code
                ,statusCode: 200 //成功的状态码，默认：0
                ,msgName: 'msg' //状态信息的字段名称，默认：msg
                ,countName: 'msg' //数据总数的字段名称，默认：count
                ,dataName: 'data' //数据列表的字段名称，默认：data
            }
            ,cols: [[ //表头
                {field: 'name', title: '用户名'},
                {field: 'companyName', title: '真实姓名'},
                {field: 'userName', title: '联系人姓名'},
                {field: 'userPhone', title: '联系人电话'},
                {field: 'classId', title: '分类ID'},
                {field: 'remarks', title: '备注'},
                {field: 'remarks', title: '备注',templet: '#operate'},
            ]]
        });
       $("#add").click(function () {
           config.openPageLayer("添加后台用户","role/addshop")
       });
    });
</script>
</body>
</html>
